package com.bjpowernode.javase.collection.review;

import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

/*
Properties:
    底层为哈希表
    初始容量为10，扩容之后的容量为原始容量的 2倍 + 1
    key和value只支持字符串
 */
public class PropertiesTest {
    public static void main(String[] args) {

        //创建对象
        Properties p = new Properties();
        p.setProperty("zhangsan","1234");
        p.setProperty("lishi","4567");


        //取；通过key取value
        String password = p.getProperty("zhangsan");
        System.out.println(password);

       Set set =  p.entrySet();
       Iterator it = set.iterator();
       while(it.hasNext()){
           System.out.println(it.next());
       }


    }
}
